//统一管理项目用户相关接口
import request from '@/utils/request'
import { readFileResponseData, saveDirFormData, saveDirResponseData } from './type'

//请求接口API
enum API {
    //用户目录句柄储存到后端
    SAVEDIRECTORY_URL = '/chatApp/savedir',
    //读取文件接口
    READFILE_URL = '/chatApp/file/',
}

//用户目录句柄储存到后端的接口方法
export const reqSaveDir = (data: saveDirFormData) =>
    request.post<any, saveDirResponseData>(API.SAVEDIRECTORY_URL, data)
//获取用户文件类型聊天记录的接口方法
export const reqReadFile = (filename: string) =>
    request.get<any, readFileResponseData>(API.READFILE_URL + filename)
